//Source file: D:\\test\\com\\ce\\pms\\customer\\model\\ClientRHouseDO.java

package com.ce.pms.customer.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import com.ce.pms.house.model.HouseDomain;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:客户-房屋关系 关联表:CS_CLIENT_R_HOUSE
 * @author Adama Yue
 */
@Entity
@Table(name = "CS_CLIENT_R_HOUSE")
public class ClientRHouseDO implements IDomainObject{
	/**
	 * 主键
	 */
	@Id
	@GeneratedValue
	@Column(name = "CLIENT_R_HOUSE_ID")
	private Long clientRHouseId;

	/**
	 * 客户
	 */
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@Cascade(value={
			CascadeType.SAVE_UPDATE
	})
	@JoinColumn(name="PARTICIPANT_ROLE_ID")
	private ClientDO client;

	/**
	 * 客户
	 */
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@JoinColumn(name="HOUSEHOLDER")
	private ClientDO houseHolder;

	/**
	 * 房屋
	 */
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@Cascade(value={
			CascadeType.SAVE_UPDATE
	})
	@JoinColumn(name="HOUSE_ID",nullable=false)
	private HouseDomain house;

	/**
	 * 产权
	 */
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@JoinColumn(name="PRO_RIGHT_ID")
	private ProRightDO proRight;

	/**
	 * 入住日期
	 */
	@Temporal(TemporalType.DATE)
	@Column(name="IN_DATE")
	private Date inDate;

	/**
	 * 搬出日期
	 */
	@Temporal(TemporalType.DATE)
	@Column(name="OUT_DATE")
	private Date outDate;

	/**
	 * 是否生效
	 * 0 无效 1 有效
	 */
	@Column(name="VALIDITY",nullable=false,length=1)
	private String validity;

	public ClientRHouseDO() {
	}
	/**
	 * mini constructor
	 * @param house 房屋
	 * @param validity 是否生效
	 */
	public ClientRHouseDO(ClientDO client,ClientDO houseHolder,HouseDomain house, String validity) {
		super();
		this.client=client;
		this.houseHolder = houseHolder;
		this.house = house;
		this.validity = validity;
	}
	/**************************************************
	 * Accessors and Modifiers
	 **************************************************/
	public ClientDO getClient() {
		return client;
	}
	public void setClient(ClientDO client) {
		this.client = client;
	}
	public Long getClientRHouseId() {
		return clientRHouseId;
	}
	public void setClientRHouseId(Long clientRHouseId) {
		this.clientRHouseId = clientRHouseId;
	}
	public HouseDomain getHouse() {
		return house;
	}
	public void setHouse(HouseDomain house) {
		this.house = house;
	}
	public Date getInDate() {
		return inDate;
	}
	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}
	public Date getOutDate() {
		return outDate;
	}
	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}
	public ProRightDO getProRight() {
		return proRight;
	}
	public void setProRight(ProRightDO proRight) {
		this.proRight = proRight;
	}
	public String getValidity() {
		return validity;
	}
	public void setValidity(String validity) {
		this.validity = validity;
	}
	public ClientDO getHouseHolder() {
		return houseHolder;
	}
	public void setHouseHolder(ClientDO houseHolder) {
		this.houseHolder = houseHolder;
	}



}
